
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>api · vue_basic_template</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Gj">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="assets.html" />
    
    
    <link rel="prev" href="../" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    概要
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">src目录</li>
        
        
    
        <li class="chapter active" data-level="2.1" data-path="api.html">
            
                <a href="api.html">
            
                    
                    api
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="assets.html">
            
                <a href="assets.html">
            
                    
                    assets
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="components.html">
            
                <a href="components.html">
            
                    
                    components
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="filters.html">
            
                <a href="filters.html">
            
                    
                    filters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="icons.html">
            
                <a href="icons.html">
            
                    
                    icons
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="layout.html">
            
                <a href="layout.html">
            
                    
                    layout
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="router.html">
            
                <a href="router.html">
            
                    
                    router
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="store.html">
            
                <a href="store.html">
            
                    
                    store
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="styles.html">
            
                <a href="styles.html">
            
                    
                    styles
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="utils.html">
            
                <a href="utils.html">
            
                    
                    utils
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="views.html">
            
                <a href="views.html">
            
                    
                    views
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="config.html">
            
                <a href="config.html">
            
                    
                    config
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >api</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x63A5;&#x53E3;&#x6587;&#x6863;&#x76EE;&#x5F55;">&#x63A5;&#x53E3;&#x6587;&#x6863;&#x76EE;&#x5F55;</h3>
<blockquote>
<p>&#x63A5;&#x53E3;&#x7EDF;&#x4E00;&#x5904;&#x7406;&#xFF0C;&#x5F15;&#x5165;&#x81EA;&#x5B9A;&#x4E49;&#x8BF7;&#x6C42;&#x5DE5;&#x5177;&#x7C7B;<strong>Request.js</strong> </p>
</blockquote>
<h5 id="requestjs">Request.js</h5>
<blockquote>
<p>&#x6587;&#x4EF6;&#x8DEF;&#x5F84; @/utils/Request.js</p>
<p>&#x662F;&#x57FA;&#x4E8E; <a href="https://github.com/axios/axios" target="_blank">axios</a><a href="https://github.com/axios/axios" target="_blank"> </a> &#x7684;&#x5C01;&#x88C5;</p>
<p>&#x8BF7;&#x6C42;&#x62E6;&#x622A;&#x3001;&#x5F02;&#x5E38;&#x4FE1;&#x606F;&#x3001;&#x8BF7;&#x6C42;&#x5934;&#x3001;&#x8FDE;&#x63A5;&#x8D85;&#x65F6;&#x7B49;&#x5904;&#x7406;&#xFF0C;&#x7EDF;&#x4E00;&#x8BBE;&#x7F6E;</p>
</blockquote>
<h5 id="cfgjs">cfg.js</h5>
<blockquote>
<p>api&#x914D;&#x7F6E;&#x6587;&#x4EF6;</p>
<p>&#x6253;&#x5305;&#x65F6;&#xFF0C;&#x662F;&#x5426;&#x9700;&#x8981;&#x524D;&#x7F00;&#xFF1A;/api</p>
</blockquote>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">export</span> <span class="token keyword">const</span> <span class="token constant">PREFIX</span> <span class="token operator">=</span> process<span class="token punctuation">.</span>env<span class="token punctuation">.</span><span class="token constant">NODE_ENV</span> <span class="token operator">===</span> <span class="token string">&quot;development&quot;</span> <span class="token operator">?</span> <span class="token string">&quot;/api&quot;</span> <span class="token operator">:</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">;</span>
</code></pre>
<h5 id="drivejs">drive.js</h5>
<blockquote>
<p>&#x9A71;&#x52A8;&#x7BA1;&#x7406;&#x63A5;&#x53E3;&#x8C03;&#x7528; &#x793A;&#x4F8B;</p>
</blockquote>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">import</span> request <span class="token keyword">from</span> <span class="token string">&quot;@/utils/Request&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> <span class="token constant">PREFIX</span> <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;./cfg&quot;</span><span class="token punctuation">;</span>

<span class="token comment">/**
 * &#x83B7;&#x53D6;&#x9A71;&#x52A8;&#x5217;&#x8868;
 * @param data
 */</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">drive_pages</span><span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token function">request</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    url<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token constant">PREFIX</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">/driver/drivers</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>
    method<span class="token operator">:</span> <span class="token string">&quot;post&quot;</span><span class="token punctuation">,</span>
    data
  <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment">/**
 * &#x8BA1;&#x7B97;&#x9A71;&#x52A8;&#x5217;&#x8868;&#x4E2A;&#x6570;
 * @param data
 */</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">drive_count</span><span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token function">request</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
    url<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token constant">PREFIX</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">/driver/drivers/count</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>
    method<span class="token operator">:</span> <span class="token string">&quot;post&quot;</span><span class="token punctuation">,</span>
    data
  <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../" class="navigation navigation-prev " aria-label="Previous page: 概要">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="assets.html" class="navigation navigation-next " aria-label="Next page: assets">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"api","level":"2.1","depth":1,"next":{"title":"assets","level":"2.2","depth":1,"path":"src/assets.md","ref":"src/assets.md","articles":[]},"previous":{"title":"概要","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","-lunr","-search","search-pro","-highlight","prism"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"chapter-fold":{},"search-pro":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Gj","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"vue_basic_template","language":"zh-hans","gitbook":"3.2.3","description":"vue基于element-ui，参照《合同》整理出的一套基础模板"},"file":{"path":"src/api.md","mtime":"2020-03-09T06:10:53.056Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-09T08:07:20.191Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

